package tank;

import java.io.IOException;
import java.util.Properties;

/**
 * @author kc
 * @date 2021/5/11 0011 23:37
 */
public class PropertyMgr {

    static Properties props = new Properties();


    static {
        try {
            props.load(PropertyMgr.class.getClassLoader().getResourceAsStream("config/config.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static Object get(String key) {

        if (null == props) {
            return null;
        }
        return props.get(key);
    }

    public static Integer getInt(String key) {
        return Integer.getInteger((String) get(key));
    }
}
